<?php

namespace DesignModel\Proxy\database;


use DesignModel\Factory;
use DesignModel\Proxy\Proxy;

/**
 * Created by PhpStorm.
 * User: 554665488
 * Date: 2018-6-21
 * Time: 15:38
 * @description: 实现主从数据库的代理 优点 1.隐藏具体的操作细节  2.Proxy可以和业务代码 部署要另外的服务器上 业务代码中通过RPC来委派任务
 * @Author: yfl
 * @QQ 554665488
 */
class DatabaseProxy implements Proxy
{
    public function getInfo($where)
    {
        $db = Factory::getDatabase('salve');
        $db->query('select * from user ');
    }

    public function updateInfo($where,$data)
    {
        $db = Factory::getDatabase('master');

        $db->query('update user set ....');
    }
}

